//
//  AliyunOSSUtils.h
//  voicetip_ios
//
//  Created by 曹欣欣 on 2019/6/17.
//  Copyright © 2019 fusw. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MBProgressHUD+showHUDs.h"
NS_ASSUME_NONNULL_BEGIN

#define YYTAPI_HTTPS_PREFIX             @"http://oa.topshunhe.com/api.php"
#define YYTAPI_GET_OSS_TOKEN            @"?m=openoss&openkey=513fb82e1e54251bb2c0bf95786d136a&a=getOSSParamet"

#define OSS_EndPoint                    @"http://oss-cn-hangzhou.aliyuncs.com"
#define OSS_bucketName                  @"fyyf-qhl"
#define UPLOAD_FILE_ERROR               @"上传文件格式错误"

@interface AliyunOSSUtils : NSObject
@property (nonatomic, strong)MBProgressHUD *hud;

typedef void(^uploadCompleted)(void);
typedef void(^uploadFailed)(void);
@property (nonatomic, copy)uploadCompleted completed;
@property (nonatomic, copy)uploadFailed failed;

@property (nonatomic, copy)void (^downloadCompleted)(NSArray *filePaths);
@property (nonatomic, copy)void (^downloadFailed)(void);

// 异步上传
- (void)uploadObjectAsync:(id)object key:(NSString *)key;
- (void)uploadObjectsAsync:(NSArray *)objects keys:(NSArray *)keys andCompletedBlock:(uploadCompleted)completedblock andFiledBlock:(uploadFailed)filedBlock;

// 异步下载
- (void)downloadObjectsAsyncWithKeys:(NSArray *)keys;


+ (NSString *)generateFileUploadKeyWithModule:(NSString *)module suffix:(NSString *)suffix;
+ (NSString *)generateImgUploadKeyWithModule:(NSString *)module suffix:(NSString *)suffix;
 
@end

NS_ASSUME_NONNULL_END

